﻿@using QuestionsAnswers.UI.Models
@model RateModel
@{
    bool auth = User.Identity.IsAuthenticated;
}

@if (auth)
{
    @Ajax.ImageActionLink(@Url.Content("~/Content/Images/Thumbs-up-icon.png"), "Rate Up", "Rating", "Rating", new { way = "up", id = Model.Id, type = Model.Type, returnUrl = Model.ReturnUrl }, new AjaxOptions { OnSuccess = "OnSuccessRating", OnFailure = "OnFailureRating" })
    <br />
}
@{ String s = "rating"+Model.Type+"Number" + Model.Id; }
<span id="@s">@Model.Rating</span><br />
@if (auth)
{
    @Ajax.ImageActionLink(@Url.Content("~/Content/Images/Thumbs-down-icon.png"), "Rate Down", "Rating", "Rating", new { way = "down", id = Model.Id, type = Model.Type, returnUrl = Model.ReturnUrl }, new AjaxOptions { OnSuccess = "OnSuccessRating", OnFailure = "OnFailureRating" })
    <br />
    }
